package com.isoftstone.common.dao;

import com.isoftstone.common.entity.SysRole;
import com.isoftstone.common.entity.SysUserRole;
import com.isoftstone.merchant.entity.role.PRoleUserKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysUserRoleMapper {
	
	//保存用户和角色的ID
	void saveUserRole(@Param(value = "userId") String userId, @Param(value = "roleId") String roleId) throws Exception ;
    
	//根据userId删除Sys_Use_Role表中的userId重复的用户信息
	void deleteUserRole(String userId) throws Exception;

	/**
	 * 根据用户名获取对应角色
	 * @param userId
	 * @return
	 * @throws Exception
	 */
    List<SysRole> getRolesByUserId(String userId)throws Exception;

	List<String> getMenuIdsByUserId(@Param("comUserCode") String comUserCode) throws Exception;

	List<PRoleUserKey> getroleIdByOperatorId(String operatorId)throws Exception;

	String getUserId(@Param("roleId") int roleId)throws Exception;

	SysUserRole getUserRoleByUserId(@Param("userId") String userId)throws Exception;
}
